<%-- 
    Document   : EliminarCargo
    Created on : 23-ene-2012, 19:36:25
    Author     : Ale
--%>


<%@page import="edu.uci.quinto.Pojos.Cargo"%>
<%@page import="edu.uci.quinto.Managers.CargoManager"%>
<%@page import="java.util.*"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%
            String mess = (String) session.getAttribute("mess");
            session.setAttribute("mess", null);
            Integer id = (int)0;
            if (request.getParameter("id")!=null)
            {
                String param = request.getParameter("id");
                if (param.length() > 0)
                    id = Integer.parseInt(param);

            }
            CargoManager cargoManager  = new CargoManager();
            Cargo  cargo= null;
            if(id > 0)
            {
                cargo = cargoManager.getCargo(id);
            }
            pageContext.setAttribute( "mess", mess);
            pageContext.setAttribute( "cargo",cargo);

        %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Eliminar Cargo</title>
    </head>
    <body>
        <a href="../index.jsp">Inicio</a>
        <h1> ${mess}</h1>
        <h1>Eliminar cargo: ${cargo.descripcion}?</h1>
        <form action="../../CargoController" method="post">
               <table frame="box">
                  <tr>
                      <th>Id:</th>
                      <td>
                          <c:if test="${cargo.id != null}"> ${cargo.id} </c:if>
                          <input name="cargoId" value="${cargo.id}" type="hidden" />
                      </td>
                  </tr>
                  <tr>
                      <th>Descripcion</th>
                      <td>${cargo.descripcion}</td>
                  </tr>
                 
                </table>
                <a href="ListCargo.jsp">Volver a la Lista</a>
                <input  type="submit" value="Eliminar" name="deleteCargo" />
          </form>
    </body>
</html>
